using System;
using System.Threading.Tasks;
using UnityEngine;

namespace GameFrameWork
{
    /// <summary>
    /// 加载模块
    /// </summary>
    public interface IResModule
    {
        /// <summary>
        /// 加载预制体prefab
        /// </summary>
        /// <param name="path"></param>
        Task<GameObject> Load(string path);
        /// <summary>
        /// 回收
        /// </summary>
        /// <param name="path"></param>
        /// <param name="prefab"></param>
        void Recycle(string path, GameObject prefab);
        /// <summary>
        /// 加载资源，内部实例化并返回
        /// </summary>
        /// <param name="path"></param>
        /// <param name="parent"></param>
        IUILoadAssetResult LoadAsset(string path, Transform parent);
        void AttachEffectSingleCancel(Transform parent, string assetName);
        /// <summary>
        /// 实例化特效并放到 parent 下, 这个接口保证只会有一个特效在节点下
        /// </summary>
        Task<GameObject> AttachEffectSingle(Transform parent, string assetName);
    }
}


